package com.company.cloud.admin.modules.admin.controller;

import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.company.cloud.admin.modules.cache.service.UserPermissionCacheService;
import com.company.cloud.common.auth.annotation.Login;
import com.company.cloud.common.bean.BaseResult;
import com.company.cloud.common.bean.LoginSimpleUserInfo;
import com.company.cloud.common.utils.AuthContextUtils;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Login
@RestController
@RequestMapping("/admin/userPer")
@Api(tags="UserMgr_用户权限校验")
public class UserPermissionMgrController {
	
	@Autowired
	private UserPermissionCacheService userPermissionCacheService;
	
	
	@GetMapping("/check")
	@ApiOperation(value="用户权限校验")
	public BaseResult get(@RequestParam("code")String code) {
		//todo
		LoginSimpleUserInfo userInfo= AuthContextUtils.getUser();
		return BaseResult.ok();
	}
	
	@GetMapping("/getUserPermCodes")
	@ApiOperation(value="获取用户权限码")
	public BaseResult getUserPermCodes() {
		//todo wjj
		LoginSimpleUserInfo  userInfo= AuthContextUtils.getUser();
		Set<String> data=null;
//		Set<String> data= userPermissionCacheService.getPermCodeByUser(userInfo);
		return BaseResult.ok(data);
	}









}
